package com.slz3.business.module.messageManagement.mesCreate.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.messageManagement.mesCreate.domain.MesCreate;
import com.slz3.business.module.messageManagement.mesCreate.domain.MesCreateCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

public class MesCreateResController extends MesCreateResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, MesCreate mesCreate) {
        if (MesCreateResUnsafeValid.add(req, mesCreate)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$MesCreateUpdateLock(req, mesCreate);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, MesCreateCondition mesCreateCondition) {
        if (MesCreateResUnsafeValid.delete(req, mesCreateCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$MesCreateUpdateLock(req, mesCreateCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, MesCreate mesCreate) {
        if (MesCreateResUnsafeValid.modify(req, mesCreate)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$MesCreateUpdateLock(req, mesCreate);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (MesCreateResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return mesCreateResAtomic.info_$MesCreateUpdateLock(req);
        if (MesCreateResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$MesCreateUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (MesCreateResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, MesCreateCondition mesCreateCondition) {
        //
        if (MesCreateResUnsafeValid.auditSubmit(req, mesCreateCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$MesCreateUpdateLock(req, mesCreateCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, MesCreateCondition mesCreateCondition) {
        if (MesCreateResUnsafeValid.audit(req, mesCreateCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$MesCreateUpdateLock(req, mesCreateCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, MesCreateCondition mesCreateCondition) {
        if (MesCreateResUnsafeValid.auditReject(req, mesCreateCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$MesCreateUpdateLock(req, mesCreateCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, MesCreateCondition mesCreateCondition) {
        if (MesCreateResUnsafeValid.usingEnable(req, mesCreateCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$MesCreateUpdateLock(req, mesCreateCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, MesCreateCondition mesCreateCondition) {
        if (MesCreateResUnsafeValid.usingDisable(req, mesCreateCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$MesCreateUpdateLock(req, mesCreateCondition);
        }
    }

}
